package tmt.usercenter.web.service;

import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tmt.usercenter.web.domain.AuthResource;
import tmt.usercenter.web.repository.IAuthResourceRepo;

import java.util.Collections;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class AuthResourceService extends TmtBaseService<AuthResource, Long> {

	@Getter
	private IAuthResourceRepo authResourceRepo;


	@Autowired
	public AuthResourceService(IAuthResourceRepo authResourceRepo) {
		super(authResourceRepo, Collections.emptyList());
		this.authResourceRepo = authResourceRepo;
	}

	@Transactional(readOnly = true)
	public List<AuthResource> findAllBySystemResource(boolean systemResource) {
		return authResourceRepo.findAllBySystemResource(systemResource);
	}
}
